package cloud.xlh.digital_power_order.exceptionhandle;

import cloud.xlh.exceptionhandle.exception.BaseException;
import cloud.xlh.exceptionhandle.exception.BusinessException;
import cloud.xlh.exceptionhandle.service.BusinessExceptionAssert;

import java.text.MessageFormat;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2023/10/7 12:52
 * @ Description:
 */
public interface DPOBusinessExceptionAssert extends BusinessExceptionAssert {
    @Override
    default BaseException newException(Object... args) {
        String msg = MessageFormat.format(this.getMessage(), args);
        return new BusinessException(this, args, msg);
    }

    @Override
    default BaseException newException(Throwable t, Object... args) {
        String msg = MessageFormat.format(this.getMessage(), args);
        return new BusinessException(this, args, msg, t);
    }
}
